package model;

import view.TextScreen;

import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.util.Observable;

/**
 * Created with IntelliJ IDEA.
 * User: phuc_lagger
 * Date: 11/10/13
 * Time: 4:03 PM
 * To change this template use File | Settings | File Templates.
 */
public class Tank implements MyUnit {
    public Point topLeft;

    public Tank(Point topLeft) {
        this.topLeft = topLeft;
    }


    @Override
    public Point getLocation() {
        return this.topLeft;
    }

    public void setLocation(Point p) {
        topLeft = p;
//        setChanged();
//        notifyObservers(p);
    }

    @Override
    public void move() {

//        KeyAdapter a = new KeyAdapter() {
//            @Override
//            public void keyPressed(KeyEvent e) {
//                int keyCode = e.getKeyCode();
//                if (keyCode == e.VK_LEFT) {
//                    if (topLeft.x > 2) {
//                        topLeft.moveLeft();
//                        setLocation(topLeft);
//
//                    }
//
//                } else if (keyCode == e.VK_RIGHT) {
//                    if (topLeft.x < 93) {
//                        topLeft.moveRight();
//                        setLocation(topLeft);
//                    }
//
//                }
//
//            }
//
////        setChanged();
////        notifyObservers(topLeft);
//        };


    }





}
